<?php

namespace app\index\controller;

use app\common\WechatAuth;
use think\Controller;
use think\Request;

defined('NOW_TIME') || define('NOW_TIME', $_SERVER['REQUEST_TIME']);
define("APPID", "wx73e68d4284c1ec8c");
define("SECRET", "71c070feedee09e8df70a231e6677b0a");
define("TOKEN", "abcdefghijk");
class shop extends Controller
{
    public function buy(){
       $a=@$_REQUEST['id'];
      $c= db('goods')->where('id',$a)->find();

//		$token = session("token");
//		if($token){
//			$auth = new WechatAuth(APPID, SECRET, $token);
//		} else {
//			$auth  = new WechatAuth(APPID, SECRET);
//			$token = $auth->getAccessToken();
//
//			session(array('expire' => $token['expires_in']));
//			session("token", $token['access_token']);
//		}
//		$userinfo = $auth->userInfo('oItfE1PtBu7HvF7Mw1DttzCTpI14');
    	return view('buy',['list'=>$c]);
	}
	
	public function mydata(){
		return view();
	}
	public function myewm(){
    	return view();
	}
	public function myhb(){
    	return view();
	}
	
}
